import request from '@/utils/request'

// const baseApi = process.env.VUE_APP_BASE_API2
const baseApi = process.env.VUE_APP_BASE_MOCKAPI

// 获取文章列表
export function getList(obj) {
  return request({
    url: baseApi + '/content/pageList',
    method: 'post',
    data: obj
  })
}

// 获取文章详情
export function getOneArticle(id) {
  return request({
    url: baseApi + '/content/' + id,
    method: 'get'
  })
}

// 添加文章
export function addList(obj) {
  return request({
    url: baseApi + '/content/add',
    method: 'post',
    data: obj
  })
}

// 更新文章
export function updateList(obj) {
  return request({
    url: baseApi + '/content/' + obj.id,
    method: 'put',
    data: obj
  })
}

// 删除文章
export function deleteList(id) {
  return request({
    url: baseApi + '/content/' + id,
    method: 'delete'
  })
}
